//
//  UIImageView+ALImageView.m
//  ALUtils_Example
//
//  Created by hcs on 2018/8/2.
//  Copyright © 2018年 anlun. All rights reserved.
//

#import "UIImageView+ALImageView.h"

@implementation UIImageView (ALImageView)
- (void)my_ImageWithSize:(CGSize)size
             cornerRadio:(CGFloat)cornerRadio{
    //width控件宽度、height控件高度
    CGRect rect = CGRectMake(0, 0, size.width, size.height);
    CGSize cornerRadio2 = CGSizeMake(cornerRadio, cornerRadio);
    UIRectCorner corner = UIRectCornerAllCorners;
    UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:corner cornerRadii:cornerRadio2];
    CAShapeLayer *masklayer = [[CAShapeLayer alloc] init];
    masklayer.frame = rect;
    masklayer.path = path.CGPath;
    self.layer.mask = masklayer;
}
- (void)my_cornerRadio:(CGFloat)cornerRadio{
    self.layer.borderColor=[UIColor clearColor].CGColor;
    self.layer.borderWidth=.1f;
    [self.layer setMasksToBounds:YES];
    [self.layer setCornerRadius:cornerRadio];
}
@end
